using System;

namespace UserManagementService.Exceptions;

/// <summary>
/// 用户名已存在异常
/// </summary>
public class UserNameAlreadyExistsException : UserManagementException
{
    public string UserName { get; }

    public UserNameAlreadyExistsException(string userName)
        : base($"用户名 '{userName}' 已存在")
    {
        UserName = userName;
    }

    public UserNameAlreadyExistsException(string userName, Exception innerException)
        : base($"用户名 '{userName}' 已存在", innerException)
    {
        UserName = userName;
    }
}